ci: fix and deduplicate rank_gene_groups tests#3966
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3966 +/- ##
=======================================
Coverage 78.26% 78.26%
=======================================
Files 117 117
Lines 12633 12634 +1
=======================================
+ Hits 9887 9888 +1
Misses 2746 2746
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| mtx = mtx.astype(np.float64) | ||
| np.divide(mtx, sums, where=sums != 0, out=mtx) |
There was a problem hiding this comment.
expect unitialized memory in output i.e., from the warning in the "failing" test, I would think out= should have the result of np.empty, not mtx. Or am I misinterpreting?
There was a problem hiding this comment.
After my change, what we do is to leave all values in mtx where sums==0 as they are (and divide the others):
mtx[sums != 0] /= sumsBefore my change we replaced all values in mtx where sums==0 with uninitialized memory (and divide the others):
mtx_new = np.empty(mtx.shape)
mtx[sums != 0] = mtx_new / sumsThere was a problem hiding this comment.
Oh wow! "If not provided or None, a freshly-allocated array is returned." from the numpy docs on divide - I didn't realize this was default behavior to return uninitialized memory. Ok then!
There was a problem hiding this comment.
Yeah, some nuts behavior. Good they have that warning now.
| mtx = mtx.astype(np.float64) | ||
| np.divide(mtx, sums, where=sums != 0, out=mtx) |
There was a problem hiding this comment.
Oh wow! "If not provided or None, a freshly-allocated array is returned." from the numpy docs on divide - I didn't realize this was default behavior to return uninitialized memory. Ok then!
…_groups tests) (#3967) Co-authored-by: Philipp A <flying-sheep@web.de>
This gets rid of potential numpy warnings by avoiding pickles in our test files.
What I did:
np.uint8s (manually checked that everything worked, it’s 40 numbers × 2 test methodsnpzwithallow_pickle=False, which is now possible, and deleted the old files[:7]is done for wilcoxon in the first test and for both in the second 🤷